package linuxbox.admin.logic;

import java.util.*;

public class UserGroup {
    protected Integer ID = null;         
    protected String name = null;
    protected String desc = null;

    protected Set userSet = new HashSet();
    protected Set rightSet = new HashSet();
    
    public UserGroup() {
		
    }
	
    public UserGroup(String n, String d) {
        name = n;
        desc = d;
    }

    public UserGroup(int id, String n, String d) {
        ID = new Integer(id);
        name = n;
        desc = d;
    }

    public int getID() {
        return ID.intValue();
    }

    public void setID(int id) {
        ID = new Integer(id);
    }

    public String getName() {
        return name;
    }
	
    public void setName(String str) {
        name = str;
    }
  
    public int getMemberCount() {
        return userSet.size();
    }
	
    public String getDesc() {
        return desc;
    }
	
    public void setDesc(String str) {
        desc = str;
    }

    public Set getUserSet() {
        return userSet;
    }
    
    public void setUserSet(Set us) {
        userSet = us;
    }
    
    public Set getRightSet() {
        return rightSet;
    }
    
    public void setRightSet(Set us) {
        rightSet = us;
    }

    public String toString() {
    	StringBuffer sb = new StringBuffer();
    	sb.append("id=" + ID);
    	sb.append("; name=" + name);
    	sb.append("; mcount=" + getMemberCount());
    	//sb.append("; userSet=" + userSet);
    	sb.append("; rightSet=" + rightSet);
    	sb.append("; desc=" + desc);
    	
    	return sb.toString();
    }
}
